<!doctype html>



  


<html class="theme-next pisces use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="GitHub," />





  <link rel="alternate" href="/atom.xml" title="crossoverJie's Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="原文链接1 在 GitHub.com 编辑代码我将从我认为大家都知道的一件事情开始(尽管我是直到一周前才知道)。
当你在 GitHub 查看文件时(任何文本文件，任何仓库中)，右上角会有一个小铅笔图标，点击它就可以编辑文件了。完成之后点击 Propose file change 按钮 GitHub 将会自动帮你 fork 该项目并且创建一个 pull request 。
很厉害吧！他自动帮你 f">
<meta property="og:type" content="article">
<meta property="og:title" content="【译】你可以用GitHub做的12件 Cool 事情">
<meta property="og:url" content="http://crossoverjie.top/2017/11/05/translation1-12 cool things you can do with GitHub/index.html">
<meta property="og:site_name" content="crossoverJie's Blog">
<meta property="og:description" content="原文链接1 在 GitHub.com 编辑代码我将从我认为大家都知道的一件事情开始(尽管我是直到一周前才知道)。
当你在 GitHub 查看文件时(任何文本文件，任何仓库中)，右上角会有一个小铅笔图标，点击它就可以编辑文件了。完成之后点击 Propose file change 按钮 GitHub 将会自动帮你 fork 该项目并且创建一个 pull request 。
很厉害吧！他自动帮你 f">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba387b5a8.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba3b3e25e.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba3eac6e5.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba43b2edd.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba48b96bc.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba54a2c40.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba58ca3f5.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba5c3e3e1.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba5e4f661.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba612afad.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1ba6b987b2.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1baf4dafe3.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1baf78ddf9.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1bafb61827.jpg">
<meta property="og:image" content="https://i.loli.net/2019/05/08/5cd1bafe8fb45.jpg">
<meta property="og:updated_time" content="2019-05-07T17:06:54.866Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="【译】你可以用GitHub做的12件 Cool 事情">
<meta name="twitter:description" content="原文链接1 在 GitHub.com 编辑代码我将从我认为大家都知道的一件事情开始(尽管我是直到一周前才知道)。
当你在 GitHub 查看文件时(任何文本文件，任何仓库中)，右上角会有一个小铅笔图标，点击它就可以编辑文件了。完成之后点击 Propose file change 按钮 GitHub 将会自动帮你 fork 该项目并且创建一个 pull request 。
很厉害吧！他自动帮你 f">
<meta name="twitter:image" content="https://i.loli.net/2019/05/08/5cd1ba387b5a8.jpg">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 555390,
      author: 'crossoverJie'
    }
  };
</script>




  <link rel="canonical" href="http://crossoverjie.top/2017/11/05/translation1-12 cool things you can do with GitHub/"/>

  <title> 【译】你可以用GitHub做的12件 Cool 事情 | crossoverJie's Blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="en">

  








  <div style="display: none;">
    <script src="https://s6.cnzz.com/stat.php?id=1259025147&web_id=1259025147" type="text/javascript"></script>
  </div>





  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">crossoverJie's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">baller</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-photo">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-photo"></i> <br />
            
            photo
          </a>
        </li>
      
        
        <li class="menu-item menu-item-jcsprout">
          <a href="https://crossoverjie.top/JCSprout/#/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-leaf"></i> <br />
            
            JCSprout
          </a>
        </li>
      
        
        <li class="menu-item menu-item-cicada">
          <a href="https://github.com/TogetherOS/cicada" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-github"></i> <br />
            
            cicada
          </a>
        </li>
      
        
        <li class="menu-item menu-item-cim">
          <a href="https://github.com/crossoverjie/cim" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-far fa-comment"></i> <br />
            
            CIM
          </a>
        </li>
      
        
        <li class="menu-item menu-item-vlog">
          <a href="https://space.bilibili.com/42339430" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-youtube"></i> <br />
            
            Vlog
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="#" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            Search
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup">
 <span class="search-icon fa fa-search"></span>
 <input type="text" id="local-search-input">
 <div id="local-search-result"></div>
 <span class="popup-btn-close">close</span>
</div>


    </div>
  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                【译】你可以用GitHub做的12件 Cool 事情
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">Posted on</span>
            <time itemprop="dateCreated" datetime="2017-11-05T01:01:54+08:00" content="2017-11-05">
              2017-11-05
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">In</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/翻译/" itemprop="url" rel="index">
                    <span itemprop="name">翻译</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
              <span class="post-comments-count">
                &nbsp; | &nbsp;
                <a href="/2017/11/05/translation1-12 cool things you can do with GitHub/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count disqus-comment-count" data-disqus-identifier="2017/11/05/translation1-12 cool things you can do with GitHub/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          

          
          
             <span id="/2017/11/05/translation1-12 cool things you can do with GitHub/" class="leancloud_visitors" data-flag-title="【译】你可以用GitHub做的12件 Cool 事情">
               &nbsp; | &nbsp;
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               <span class="post-meta-item-text">visitors </span>
               <span class="leancloud-visitors-count"></span>
              </span>
          

          
              &nbsp; | &nbsp;
              <span class="page-pv">本文总阅读量
              <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>次
              </span>
          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="https://i.loli.net/2019/05/08/5cd1ba387b5a8.jpg" alt=""></p>
<h3 id="原文链接"><a href="#原文链接" class="headerlink" title="原文链接"></a><a href="https://hackernoon.com/12-cool-things-you-can-do-with-github-f3e0424cf2f0" target="_blank" rel="external">原文链接</a></h3><h2 id="1-在-GitHub-com-编辑代码"><a href="#1-在-GitHub-com-编辑代码" class="headerlink" title="1 在 GitHub.com 编辑代码"></a>1 在 GitHub.com 编辑代码</h2><p>我将从我认为大家都知道的一件事情开始(尽管我是直到一周前才知道)。</p>
<p>当你在 GitHub 查看文件时(任何文本文件，任何仓库中)，右上角会有一个小铅笔图标，点击它就可以编辑文件了。完成之后点击 <strong>Propose file change</strong> 按钮 GitHub 将会自动帮你 fork 该项目并且创建一个 <code>pull request</code> 。</p>
<p>很厉害吧！他自动帮你 <code>fork</code> 了该 repo。</p>
<p>不再需要 <code>fork</code> , <code>pull</code> ,本地编辑再 <code>push</code> 以及创建一个 <code>PR</code> 这样的流程了。<br><img src="https://i.loli.net/2019/05/08/5cd1ba3b3e25e.jpg" alt=""></p>
<p>这非常适合修复编写代码中出现的拼写错误和修正一个不太理想的想法。</p>
<h2 id="2-粘贴图片"><a href="#2-粘贴图片" class="headerlink" title="2 粘贴图片"></a>2 粘贴图片</h2><p>你不仅仅受限于输入文本和描述问题，你知道你可以直接从粘贴板中粘贴图片吗？当你粘贴时，你会看到图片已经被上传了(毫无疑问被上传到云端)之后会变成 <code>Markdown</code> 语法来显示图片。</p>
<h2 id="3-格式化代码"><a href="#3-格式化代码" class="headerlink" title="3 格式化代码"></a>3 格式化代码</h2><p>如果你想写一段代码，你可以三个反引号开始 —— 就像你在<a href="https://guides.github.com/features/mastering-markdown/" target="_blank" rel="external">研究<code>MarkDown</code></a>时所学到的 —— 之后 GitHub 会试着猜测你写的语言。</p>
<p>但如果你写了一些类似于 Vue, Typescript, JSX 这样的语言，你可以明确指定得到正确的高亮。</p>
<p>注意第一行中的<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">```jsx</div></pre></td></tr></table></figure></p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba3eac6e5.jpg" alt=""></p>
<a id="more"></a>
<p>这意味着代码段将会呈现出:</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba43b2edd.jpg" alt=""></p>
<p>(这个扩展于 <code>gists</code> 。顺便说一句，如果你使用 <code>.jsx</code> 后缀，就会得到JSX的语法高亮)</p>
<p>这是一个所有受支持的<a href="https://github.com/github/linguist/blob/fc1404985abb95d5bc33a0eba518724f1c3c252e/vendor/README.md" target="_blank" rel="external">语法列表</a>。</p>
<h2 id="4-在-PR-中用关键词关闭-Issues"><a href="#4-在-PR-中用关键词关闭-Issues" class="headerlink" title="4 在 PR 中用关键词关闭 Issues"></a>4 在 PR 中用关键词关闭 Issues</h2><p>假设你创建了一个用于修复 <code>Issues #234</code> 的 PR ,你可以在你 PR 的描述中填写 <code>fixes #234</code> (或是在你 PR 任意评论中填写都是可以的)。<br>之后合并这个 <code>PR</code> 时将会自动关闭填写的 <code>Issues</code>。怎么样,很 cool 吧。</p>
<p>了解是更多相关的<a href="https://help.github.com/articles/closing-issues-using-keywords/" target="_blank" rel="external">内容</a>。</p>
<h2 id="5-链接到评论"><a href="#5-链接到评论" class="headerlink" title="5 链接到评论"></a>5 链接到评论</h2><p>你是否有过想要链接到特殊 <code>comment</code> 的想法但却无法实现？那是因为你不知道怎么做。朋友那都是过去式了，现在我就告诉你，点击用户名旁边的日期/时间即可链接到该 <code>comment</code> 。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba48b96bc.jpg" alt=""></p>
<h2 id="6-链接到代码"><a href="#6-链接到代码" class="headerlink" title="6 链接到代码"></a>6 链接到代码</h2><p>我知道你想链接到具体的代码行上。</p>
<p>尝试:查看文件时，点击代码旁边的行号。</p>
<p>看到了吧，浏览器的 <code>URL</code> 已经被更新为行号了。如果你按住 <code>shift</code>,同时点击其他行号，<code>URL</code> 再次被更新，并且你也高亮显示页面中的一段代码。</p>
<p>分享这个 URL ，访问时将会链接到该文件已经选中的那些代码段。</p>
<p>但等一下，那指向的是当前的分支，如果文件发生了改变呢？也许一个在当前状态连接到文件的永久连接正是你想要的。</p>
<p>我很懒，所以用一张截图展示以上的所有操作。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba54a2c40.jpg" alt=""></p>
<p>谈到网址。。。</p>
<h2 id="7-像命令行一样使用-GitHub-链接"><a href="#7-像命令行一样使用-GitHub-链接" class="headerlink" title="7 像命令行一样使用 GitHub 链接"></a>7 像命令行一样使用 GitHub 链接</h2><p>使用 GitHub 自带的 UI 浏览也还不错，但有时直接在 URL 中输入是最快的方法。比如，我想跳转到我正在编辑的分支并和 <code>master</code> 进行对比，就可以在项目名称后面接上 <code>/compare/branch-name</code> 。</p>
<p>与选中分支的对比页将会显示出来:<br><img src="https://i.loli.net/2019/05/08/5cd1ba58ca3f5.jpg" alt=""></p>
<p>以上就是和 master 分支的差异，如果想要合并分支的话，只需要输入 <code>/compare/integration-branch...my-branch</code> 即可。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba5c3e3e1.jpg" alt=""></p>
<p>你还可以利用快捷键达到同样的效果，使用 <code>ctrl + L</code> 或者 <code>cmd + L</code> 可以将光标移动到 <code>URL</code> 上(至少在 Chrome 中可以)。 加上浏览器的自动补全 —— 你就可以在两个分支之间轻松切换了。</p>
<h2 id="8-在Issues创建列表"><a href="#8-在Issues创建列表" class="headerlink" title="8 在Issues创建列表"></a>8 在Issues创建列表</h2><p>你想在你的 issue 中看到复选框列表吗?</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba5e4f661.jpg" alt=""></p>
<p>你想在查看 issue 列表是它们以好看的 <code>2 of 5</code> 进度条呈现吗？</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba612afad.jpg" alt=""></p>
<p>太好了！你可以用以下语法来创建一个交互性的复选框:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">- [ ] Screen width (integer)</div><div class="line">- [x] Service worker support</div><div class="line">- [x] Fetch support</div><div class="line">- [ ] CSS flexbox support</div><div class="line">- [ ] Custom elements</div></pre></td></tr></table></figure>
<p>是由一个空格、中横线、空格、左括号、空格(或者是 X )、右括号、空格以及一些文本组成。</p>
<p>你甚至可以真正的 选中/取消 这些复选框！基于某些原因，对于我来说你看起来像是技术魔力。是真的能够选中这些复选框！甚至它还更新了底层源码。</p>
<blockquote>
<p>ps：以下包括第九点 基于GitHub的项目面板 由于用的不多就没有翻译。</p>
</blockquote>
<h2 id="10-GitHub-wiki"><a href="#10-GitHub-wiki" class="headerlink" title="10 GitHub wiki"></a>10 GitHub wiki</h2><p>作为一个像维基百科那样的非结构化的页面集合， <code>GitHub Wiki</code>的供给(我把它称之为 <code>Gwiki</code> ) 是一个非常棒的功能。</p>
<p>对于结构化的页面来说 —— 例如你的文档：不能说这个页面是其他页面的子页面，或则是有 “下一节”，“上一节” 这样的便捷按钮。并且 <code>Hansel</code> 和 <code>Gretel</code> 也没有，因为结构化页面并没有 <code>breadcrumbs</code> 这样的设计。</p>
<p>我们继续，让 Gwiki 动起来，我从 <code>NodeJS</code> 的文档中复制了几页来作为 wiki 页面。然后创建了一个自定义侧边栏，帮助我更好地模拟一些实际的目录结构。尽管它不会突出显示你当前的页面位置，但侧边栏会一直存在。</p>
<p>这些链接需要你手动维护，但总的来说，我认为它可以做得很好。 如果需要的话可以<a href="https://github.com/davidgilbertson/about-github/wiki" target="_blank" rel="external">看看</a>。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1ba6b987b2.jpg" alt=""></p>
<p>虽然它与 <code>GitBook</code> ( <a href="http://redux.js.org/" target="_blank" rel="external">Redux 文档</a>所使用的)或者是定制网站相比仍有差距。但在你的 repo 中它有 80% 完全值得信赖的。</p>
<p>我的建议是: 如果你已经有多个 <code>README.md</code> 文件，并且想要一些关于用户指南或更详细的文档的不同的页面，那么你应该选择 <code>Gwiki</code>。</p>
<p>如果缺乏结构化/导航开始让你不爽的话，那就试试其他的吧。</p>
<h2 id="11-GitHub-Pages"><a href="#11-GitHub-Pages" class="headerlink" title="11 GitHub Pages"></a>11 GitHub Pages</h2><p>你可能已经知道使用 <code>GitHub Pages</code> 来托管一个静态网站。如果你不知道，现在就来学习，这一节是专门用于讨论使用 <code>Jekyll</code> 来构建一个站点的。</p>
<p>最简单的就是： <code>GitHub Pages + Jekyll</code>会通过一个漂亮的主题来渲染你的 <code>README.md</code> 文件。例如:通过 <a href="https://github.com/davidgilbertson/about-github" target="_blank" rel="external">about-github</a>  来查看的我的 <code>README</code> 页面。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1baf4dafe3.jpg" alt=""></p>
<p>如果我在 GitHub 中点击了 <code>settings</code>选项，切换到 <code>Github Pages</code> 设置，然后选择一个 <code>Jekyll theme</code>。。。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1baf78ddf9.jpg" alt=""></p>
<p>我就可以得到 <a href="https://davidgilbertson.github.io/about-github/" target="_blank" rel="external">Jekyll-themed 页面</a>。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1bafb61827.jpg" alt=""></p>
<p>从这点上我可以主要依据易编辑的 <code>Markdown</code> 文件来构建一个完整的静态站点。本质上是把 GitHub 变成了 <code>CMS</code>。</p>
<p>虽然我没有实际使用过，但是 <code>React Bootstrap</code> 的网站都是使用它来构建的。所以它不会糟糕。</p>
<p>注意:它要求 <code>Ruby</code> 运行本地环境( Windows 自行安装， macOS 自带)。</p>
<h2 id="12-把-GitHub-当做-CRM-使用"><a href="#12-把-GitHub-当做-CRM-使用" class="headerlink" title="12 把 GitHub 当做 CRM 使用"></a>12 把 GitHub 当做 CRM 使用</h2><p>假设你有一个存有一些文本内容的网站，你不想将文本内容存储于真正的 <code>HTML</code> 源码中。</p>
<p>相反的，你想要将这些文本块存储于非开发人员能轻松的进行编辑的地方。可能是一个版本控制系统，甚至是一个审核流程。</p>
<p>我的建议是:使用 GitHub 厂库中的 Markdown 文件来存储这些文本内容，然后使用前端组件来拉取这些文本块并展示在页面上。</p>
<p>我是搞 <code>React</code> 的，所以这有一个 解析 <code>Markdown</code> 的组件例子，给定一些 <code>Markdown</code> 文件路径，它将会自动拉取并作为 <code>HTML</code> 显示出来。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div></pre></td><td class="code"><pre><div class="line">class Markdown extends React.Component &#123;</div><div class="line">    constructor(props) &#123;</div><div class="line">      super(props);</div><div class="line">      </div><div class="line">      // replace with your URL, obviously</div><div class="line">      this.baseUrl = &apos;https://raw.githubusercontent.com/davidgilbertson/about-github/master/text-snippets&apos;;</div><div class="line">      </div><div class="line">      this.state = &#123;</div><div class="line">        markdown: &apos;&apos;,</div><div class="line">      &#125;;</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    componentDidMount() &#123;</div><div class="line">      fetch(`$&#123;this.baseUrl&#125;/$&#123;this.props.url&#125;`)</div><div class="line">        .then(response =&gt; response.text())</div><div class="line">        .then((markdown) =&gt; &#123;</div><div class="line">          this.setState(&#123;markdown&#125;);</div><div class="line">        &#125;);</div><div class="line">    &#125;</div><div class="line"></div><div class="line">    render() &#123;</div><div class="line">      return (</div><div class="line">        &lt;div dangerouslySetInnerHTML=&#123;&#123;__html: marked(this.state.markdown)&#125;&#125; /&gt;</div><div class="line">      );</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<h3 id="奖励环节-——-GitHub-工具"><a href="#奖励环节-——-GitHub-工具" class="headerlink" title="奖励环节 —— GitHub 工具"></a>奖励环节 —— GitHub 工具</h3><p>我已经使用了 <a href="https://chrome.google.com/webstore/detail/octotree/bkhaagjahfmjljalopjnoealnfndnagc?hl=en-US" target="_blank" rel="external">Octotree Chrome extension</a> 有段时间了，现在我向大家推荐它！<br>无论你是在查看哪个 repo 它都会在左侧给你一个树状面板。</p>
<p><img src="https://i.loli.net/2019/05/08/5cd1bafe8fb45.jpg" alt=""></p>
<p>通过这个<a href="https://www.youtube.com/watch?v=NhlzMcSyQek&amp;index=2&amp;list=PLNYkxOF6rcIB3ci6nwNyLYNU6RDOU3YyL" target="_blank" rel="external">视频</a>我了解到了 octobox，它是用于管理你的 <code>GitHub Issues</code> 收件箱，看起来相当不错！<br>以上就是我针对于<code>octobox</code>的全部想法。</p>
<h2 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h2><p>就是这样了！我希望这里至少有三件事是你还不知道的。</p>
<p>最后: hava a nice day！</p>

      
    </div>

    <div>
      
        
<div id="wechat_subscriber" style="display: block； padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/uploads/weixinfooter1.jpg" alt="crossoverJie wechat" style="width: 200px; max-width: 100%;"/>
    <div>我很有眼光！</div>
</div>

      
    </div>

    <div>
      
        
  <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
    <div>请我吃🍗</div>
    <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
      <span>赏</span>
    </button>
    <div id="QR" style="display: none;">
      
        <div id="wechat" style="display: inline-block">
          <img id="wechat_qr" src="/weixin-reward-image.jpg" alt="crossoverJie WeChat Pay"/>
          <p>微信打赏</p>
        </div>
      
      
        <div id="alipay" style="display: inline-block">
          <img id="alipay_qr" src="/alipay-reward-image.jpg" alt="crossoverJie Alipay"/>
          <p>支付宝打赏</p>
        </div>
      
    </div>
  </div>


      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/GitHub/" rel="tag">#GitHub</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/10/20/SSM17/" rel="next" title="SSM(十七) MQ应用">
                <i class="fa fa-chevron-left"></i> SSM(十七) MQ应用
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/11/28/sbc6/" rel="prev" title="sbc(六) Zuul GateWay 网关应用">
                sbc(六) Zuul GateWay 网关应用 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  <p>热评文章</p>
  <div class="ds-top-threads" data-range="weekly" data-num-items="4"></div>


          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            Table of Contents
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            Overview
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/uploads/crossoverjie.jpg"
               alt="crossoverJie" />
          <p class="site-author-name" itemprop="name">crossoverJie</p>
          <p class="site-description motion-element" itemprop="description">You never know what you can do till you try.</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">116</span>
              <span class="site-state-item-name">posts</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">45</span>
                <span class="site-state-item-name">categories</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">109</span>
                <span class="site-state-item-name">tags</span>
              </a>
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/crossoverJie" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://www.jianshu.com/users/e2d07947c112/latest_articles" target="_blank" title="简书">
                  
                    <i class="fa fa-fw fa-book"></i>
                  
                  简书
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://juejin.im/user/576d4aaf7db2a20054ea4544" target="_blank" title="掘金">
                  
                    <i class="fa fa-fw fa-bookmark"></i>
                  
                  掘金
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/crossoverJie" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链接
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://wuchong.me" title="Jark's Blog" target="_blank">Jark's Blog</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://tengj.top" title="嘟嘟独立博客" target="_blank">嘟嘟独立博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://yemengying.com/" title="Giraffe Home" target="_blank">Giraffe Home</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://blog.jamespan.me/" title="潘小鶸(ruò)" target="_blank">潘小鶸(ruò)</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://fangjian0423.github.io/" title="Format's Notes" target="_blank">Format's Notes</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://yuzhouwan.com/" title="Benedict Jin" target="_blank">Benedict Jin</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://blog.didispace.com/" title="程序猿DD" target="_blank">程序猿DD</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://blog.52itstyle.vip/" title="小柒博客" target="_blank">小柒博客</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://cmsblogs.com/" title="Java技术驿站" target="_blank">Java技术驿站</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://vim.ink/" title="vim 教程网" target="_blank">vim 教程网</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.jitwxs.cn" title="jitwxs" target="_blank">jitwxs</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.javaboy.org" title="江南一点雨" target="_blank">江南一点雨</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.liangsonghua.me" title="松花皮蛋的黑板报" target="_blank">松花皮蛋的黑板报</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.fi-ads.com" title="Future iDeal" target="_blank">Future iDeal</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#原文链接"><span class="nav-number">1.</span> <span class="nav-text">原文链接</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-在-GitHub-com-编辑代码"><span class="nav-number"></span> <span class="nav-text">1 在 GitHub.com 编辑代码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-粘贴图片"><span class="nav-number"></span> <span class="nav-text">2 粘贴图片</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-格式化代码"><span class="nav-number"></span> <span class="nav-text">3 格式化代码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#4-在-PR-中用关键词关闭-Issues"><span class="nav-number"></span> <span class="nav-text">4 在 PR 中用关键词关闭 Issues</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#5-链接到评论"><span class="nav-number"></span> <span class="nav-text">5 链接到评论</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#6-链接到代码"><span class="nav-number"></span> <span class="nav-text">6 链接到代码</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#7-像命令行一样使用-GitHub-链接"><span class="nav-number"></span> <span class="nav-text">7 像命令行一样使用 GitHub 链接</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#8-在Issues创建列表"><span class="nav-number"></span> <span class="nav-text">8 在Issues创建列表</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#10-GitHub-wiki"><span class="nav-number"></span> <span class="nav-text">10 GitHub wiki</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#11-GitHub-Pages"><span class="nav-number"></span> <span class="nav-text">11 GitHub Pages</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#12-把-GitHub-当做-CRM-使用"><span class="nav-number"></span> <span class="nav-text">12 把 GitHub 当做 CRM 使用</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#奖励环节-——-GitHub-工具"><span class="nav-number">1.</span> <span class="nav-text">奖励环节 —— GitHub 工具</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#其他"><span class="nav-number"></span> <span class="nav-text">其他</span></a></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2016 - 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">crossoverJie</span>
</div>

<div class="powered-by">
  Powered by <a class="theme-link" href="http://hexo.io">Hexo</a>
</div>

<div class="theme-info">
  Theme -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

        

<div class="busuanzi-count">

  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv"><i class="fa fa-user"></i><span class="busuanzi-value" id="busuanzi_value_site_uv"></span>人数</span>
  

  
    <span class="site-pv">您是第<span class="busuanzi-value" id="busuanzi_value_site_pv"></span>位童鞋</span>
  
  
</div>



        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.0.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  



  

    <script type="text/javascript">
      var disqus_shortname = 'crossoverjie';
      var disqus_identifier = '2017/11/05/translation1-12 cool things you can do with GitHub/';
      var disqus_title = "【译】你可以用GitHub做的12件 Cool 事情";
      var disqus_url = 'http://crossoverjie.top/2017/11/05/translation1-12 cool things you can do with GitHub/';

      function run_disqus_script(disqus_script){
        var dsq = document.createElement('script');
        dsq.type = 'text/javascript';
        dsq.async = true;
        dsq.src = '//' + disqus_shortname + '.disqus.com/' + disqus_script;
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
      }

      run_disqus_script('count.js');
      
        run_disqus_script('embed.js');
      
    </script>
  




  
  
  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length == 0) {
       search_path = "search.xml";
    }
    var path = "/" + search_path;
    // monitor main search box;

    function proceedsearch() {
      $("body").append('<div class="popoverlay">').css('overflow', 'hidden');
      $('.popup').toggle();

    }
    // search function;
    var searchFunc = function(path, search_id, content_id) {
    'use strict';
    $.ajax({
        url: path,
        dataType: "xml",
        async: true,
        success: function( xmlResponse ) {
            // get the contents from search data
            isfetched = true;
            $('.popup').detach().appendTo('.header-inner');
            var datas = $( "entry", xmlResponse ).map(function() {
                return {
                    title: $( "title", this ).text(),
                    content: $("content",this).text(),
                    url: $( "url" , this).text()
                };
            }).get();
            var $input = document.getElementById(search_id);
            var $resultContent = document.getElementById(content_id);
            $input.addEventListener('input', function(){
                var matchcounts = 0;
                var str='<ul class=\"search-result-list\">';                
                var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                $resultContent.innerHTML = "";
                if (this.value.trim().length > 1) {
                // perform local searching
                datas.forEach(function(data) {
                    var isMatch = true;
                    var content_index = [];
                    var data_title = data.title.trim().toLowerCase();
                    var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
                    var data_url = data.url;
                    var index_title = -1;
                    var index_content = -1;
                    var first_occur = -1;
                    // only match artiles with not empty titles and contents
                    if(data_title != '' && data_content != '') {
                        keywords.forEach(function(keyword, i) {
                            index_title = data_title.indexOf(keyword);
                            index_content = data_content.indexOf(keyword);
                            if( index_title < 0 && index_content < 0 ){
                                isMatch = false;
                            } else {
                                if (index_content < 0) {
                                    index_content = 0;
                                }
                                if (i == 0) {
                                    first_occur = index_content;
                                }
                            }
                        });
                    }
                    // show search results
                    if (isMatch) {
                        matchcounts += 1;
                        str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
                        var content = data.content.trim().replace(/<[^>]+>/g,"");
                        if (first_occur >= 0) {
                            // cut out 100 characters
                            var start = first_occur - 20;
                            var end = first_occur + 80;
                            if(start < 0){
                                start = 0;
                            }
                            if(start == 0){
                                end = 50;
                            }
                            if(end > content.length){
                                end = content.length;
                            }
                            var match_content = content.substring(start, end);
                            // highlight all keywords
                            keywords.forEach(function(keyword){
                                var regS = new RegExp(keyword, "gi");
                                match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
                            });
                            
                            str += "<p class=\"search-result\">" + match_content +"...</p>"
                        }
                        str += "</li>";
                    }
                })};
                str += "</ul>";
                if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
                if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
                $resultContent.innerHTML = str;
            });
            proceedsearch();
        }
    });}

    // handle and trigger popup window;
    $('.popup-trigger').mousedown(function(e) {
      e.stopPropagation();
      if (isfetched == false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };

    });

    $('.popup-btn-close').click(function(e){
      $('.popup').hide();
      $(".popoverlay").remove();
      $('body').css('overflow', '');
    });
    $('.popup').click(function(e){
      e.stopPropagation();
    });
  </script>

  

  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
  <script>AV.initialize("Qv6ckEtL1pe3PJD10qoOLKtg-gzGzoHsz", "NXiHFodQfmI8oxkK6IThhjrF");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  
<script type="text/javascript" src="/js/src/particle.js" count="50" zindex="-2" opacity="1" color="0,104,183"></script>
</body>
</html>
